package com;

import com.pojo.Customer;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class MyBatisTes {
    @Test
    public void findCustomerByNameAndJobsTes(){
        SqlSession sqlSession = MyBatisUtils.getSession();
        Customer customer = new Customer();
//        customer.setUsername("jack");
//        customer.setJobs("teacher");
        List<Customer> customers = sqlSession.
                selectList("com.mapper.CustomerMapper.findCustomerByNameAndJobsTes");
        for (Customer customer1 : customers) {
            System.out.println(customer1.toString());
        }
        sqlSession.commit();
        sqlSession.close();
    }
    @Test
    public void findByArrayTes(){
        SqlSession sqlSession = MyBatisUtils.getSession();
        Customer [] roleIds = {2,3};
        List<Customer> customers = sqlSession.selectList("com.mapper.CustomerMapper.findByArray",roleIds);
        for (Customer customer1 : customers) {
            System.out.println(customer1);
        }
        sqlSession.commit();
        sqlSession.close();
    }
}
